<template>
  <div id="app">
    <div class="layout">
      <Layout>
        <Header>
          <div class="flex-bet">
            <div class="flex-g-1 flex">
              <a href="#" target="_self" class="i-link i-layout-header-logo i-link-color i-layout-header-logo-stick">
                <img :src="headLogo" v-if="headLogo" />
              </a>
              <div class="modal-name">
                <template v-for="(leftmenu) in leftMenu">
                  <template v-if="leftmenu.c_name==storeMenuCurrent">
                     <div v-for="(list1,Pindex) in leftmenu.children" :key="Pindex">
                        <MenuItem class="noChildmenuitem" :name="list1.c_name" :to="list1.c_name">
                           {{ list1.nav_name }}
                        </MenuItem>
                     </div>
                  </template>
				</template>
              </div>			  
            </div>
            <div class="flex-g-0">
              <div class="right_model flex-y-center fr">
                <div class="mar_r20">
                  <el-button type="text">
                    <i class="el-icon-search el-icon color_3 fon_18"></i>
                  </el-button>
                </div>
                <div class="mar_r20">
                  <el-button type="text">
                    <i class="el-icon-message-solid el-icon color_3 fon_18"></i>
                  </el-button>
                </div>				  
                <el-dropdown trigger="click">
                  <div class="flex-y-center">
                    <img :src="portrait" v-if="portrait" alt="logo" class="logo2 mar_r15 bor_rad50" />
                    <img v-else alt="logo" src="@/assets/img/moren.png" class="logo2 mar_r15 bor_rad50" />
                  </div>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>
                      <a class="color_3" @click="myNumber">我的账号</a>
                    </el-dropdown-item>
                    <el-dropdown-item v-if="loginType!=2">
                      <a class="color_3" @click="returnSystem">返回系统</a>
                    </el-dropdown-item>
                    <el-dropdown-item>
                      <a class="color_3" @click="outSystem">退出系统</a>
                    </el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </div>
            </div>
          </div>  
			<div class="left-menu-1">			
              <div class="oneMenu">
                <Menu mode="horizontal" theme="primary" width="auto" :active-name="menuCurrent" @on-select="showToggle">
                  <div class="layout-logo"></div>
                  <div class="layout-nav flex-wrap">
                    <template v-for="(topmenu,index) in topMenu">
                      <MenuItem :name="topmenu.c_name?topmenu.c_name:'/'" :key="index">
                        <span class="mar_r5 iconfont" :class="topmenu.icon"></span>
                        {{topmenu.nav_name}}
                      </MenuItem>
                    </template>
                  </div>
                </Menu>
              </div>			
			</div>	
        </Header>
        <Layout>
          <Sider hide-trigger style="width: 140px;min-width: 140px;max-width: 140px;flex: 0 0 140px;background: rgb(255, 255, 255);margin-left: 120px;" class="flex-nowrap leftLayout">
            <template v-for="(leftmenu,index) in leftMenu">
              <template v-if="leftmenu.c_name==storeMenuCurrent">
                <Menu ref="side_menu" theme="light" width="auto" :open-names="leftOpenName" :active-name="leftActive" @on-select="showSubmenu" @on-open-change="showSubOpenmenu" :key="index">
                  <div v-for="(list1,Pindex) in leftmenu.children" :key="Pindex">
                    <Submenu v-if="list1.children&&list1.children.length!==0" :name="list1.c_name">
                      <template slot="title">
                        <span>{{list1.nav_name}}</span>
                      </template>
                      <menu-item style="padding-left: 30px;" :name="list2.c_name" v-for="list2 in list1.children" :to="list2.c_name" :key="list2.id" @click.native="updataNumber(list2.hot)">
                        <span v-if="list2.hot==null || !list2.hot || list2.hot=='0' ||orderNumber==0">{{list2.nav_name}}</span>
                        <el-badge v-else :value="orderNumber" class="item">
                          <span >{{list2.nav_name}}</span>
                        </el-badge>
                      </menu-item>
                    </Submenu>
                    <MenuItem class="noChildmenuitem" v-else :name="list1.c_name" :to="list1.c_name">
                      {{ list1.nav_name }}
                    </MenuItem>
                  </div>
                </Menu>
              </template>
            </template>
            <Menu :active-name="leftActive" theme="light" width="auto" ref="side_menu" :open-names="leftOpenName" v-if="menuCurrent==13" @on-select="showSubmenu" @on-open-change="showSubOpenmenu">
              <MenuItem name="1">
                <Icon type="ios-navigate"></Icon>账号管理
              </MenuItem>
            </Menu>
          </Sider>
          <Layout :style="{padding: '20px 20px 20px 20px'}">
            <Content>
              <div>
                <audio ref="newsUrl" id="newsUrl" muted="muted" :src="newsUrl"></audio>
                <audio ref="urgeOrderUrl" id="urgeOrderUrl" muted="muted" :src="urgeOrderUrl"></audio>
                <audio ref="cancelOrderUrl" id="cancelOrderUrl" muted="muted" :src="cancelOrderUrl"></audio>
                <audio ref="retreatOrderUrl" id="retreatOrderUrl" muted="muted" :src="retreatOrderUrl"></audio>
                <audio ref="autoOrderUrl" id="autoOrderUrl" muted="muted" :src="autoOrderUrl"></audio>
              </div>
              <router-view />
              <div v-if="edition==1">
                <div class="ba_f t_c copayRight" v-if="copy">{{copy}}</div>
              </div>
            </Content>
          </Layout>
        </Layout>
      </Layout>
    </div>
    <div style="height: 0; overflow: hidden">
      <ElementPrint :data="printData" ref="print" />
    </div>
  </div>
</template>
<script>
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/public.css';
import './assets/css/elecustom.css';
import './assets/css/page.css';
import './assets/css/iconfont.css';
import { getConfig, getEdition, getCopy } from '@/api/setup';
import { getUrl, signOut, waitReceiv, selectStore, checkRoleNav } from '@/api/public';
import index from './api/index';
import { mapState, mapActions, mapMutations } from 'vuex';
import {orderContent} from "@/api/order";
import ElementPrint from "@/views/order/components/elementPrint";

export default {
  name: 'App',
  components:{
    ElementPrint
  },
  data() {
    return {
      printData: {},
      orderNumber: '',
      shopYysj: '',
      headLogo: '',
      portrait: '',
      loginType: '',
      copy: '',
      menuCurrent: '/',
      leftActive: '1',
      leftOpenName: ['1'],
      topMenuceshi: [
        {
          c_name: '/',
          nav_name: '概况',
          icon: 'iconshouye'
        },
        {
          c_name: 'renovationindex',
          nav_name: '店铺',
          icon: 'iconshanghu1'
        },
        {
          c_name: 'orderprocessing',
          nav_name: '外卖',
          icon: 'iconwaimai'
        },
        {
          c_name: 'instoresurvey',
          nav_name: '店内',
          icon: 'icondiancan-copy'
        },
        {
          c_name: 'good',
          nav_name: '商品',
          icon: 'iconshangpin'
        },
        {
          c_name: 'usersurvey',
          nav_name: '用户',
          icon: 'iconkehu'
        },
        {
          c_name: 'assetssurvey',
          nav_name: '财务',
          icon: 'iconcaiwu'
        },
        {
          c_name: 'shopsurvey',
          nav_name: '门店',
          icon: 'iconmendian'
        },
        {
          c_name: 'datasurvey',
          nav_name: '数据',
          icon: 'iconshuju'
        },
        {
          c_name: 'application',
          nav_name: '应用',
          icon: 'iconyingyong'
        },

        {
          c_name: 'appletlist',
          nav_name: '权限',
          icon: 'iconquanxian'
        },
        {
          c_name: 'baseset',
          nav_name: '设置',
          icon: 'iconshezhi'
        },		
      ],
      leftMenuceshi: [
        {
          c_name: '/',
          children: [
            {
              id: '11',
              nav_name: '商户概况',
              c_name: 'storesurvey',
              icon: 'iconshanghuchaxunsvg'
            },
            {
              id: '22',
              nav_name: '商户信息',
              c_name: 'storeinformation',
              icon: 'iconshanghuruwangsvg'
            }
          ]
        },
        {
          c_name: 'instoresurvey',
          children: [
            {
              id: '21',
              nav_name: '店内概况',
              c_name: 'instoresurvey',
              icon: 'icongaikuang1'
            },
            {
              id: '24',
              nav_name: '订单管理',
              icon: 'iconicon-',
              children: [
                {
                  id: '241',
                  nav_name: '堂食订单',
                  c_name: 'instoreorder',
                  status: true
                },
                {
                  id: '242',
                  nav_name: '快餐订单',
                  c_name: 'infastorder'
                },
                {
                  id: '243',
                  nav_name: '当面付订单',
                  c_name: 'cashierorder'
                }
              ]
            },
            {
              id: '22',
              nav_name: '桌码管理',
              icon: 'icondiandan',
              children: [
                {
                  id: '222',
                  nav_name: '桌位管理',
                  c_name: 'table'
                },
                {
                  id: '221',
                  nav_name: '活码管理',
                  c_name: 'tablemanager'
                },
                {
                  id: '221',
                  nav_name: '门店码',
                  c_name: 'tablecode'
                }
              ]
            },
            {
              id: '21',
              nav_name: '店内设置',
              c_name: 'instoreset',
              icon: 'iconshezhi4'
            },
            {
              id: '26',
              nav_name: '打印机管理',
              c_name: 'inprinterset',
              icon: 'iconicon_xinyong_xianxing_jijin-'
            }
          ]
        },
        {
          c_name: 'orderprocessing',
          children: [
            {
              id: '1',
              nav_name: '订单处理',
              icon: 'icondingdan',
              children: [
                {
                  id: '1-1',
                  nav_name: '订单处理',
                  c_name: 'orderprocessing',
                  status: true
                },
                {
                  id: '1-2',
                  nav_name: '订单查询',
                  c_name: 'orderinquiry'
                },
                {
                  id: '1-3',
                  nav_name: '自提订单',
                  c_name: 'selforder'
                },
                {
                  id: '1-4',
                  nav_name: '饿了么订单',
                  c_name: 'elemorder'
                },
                {
                  id: '1-5',
                  nav_name: '美团订单',
                  c_name: 'meituanorder'
                }
              ]
            },
            {
              id: '2',
              nav_name: '订单提醒',
              icon: 'icontixing',
              children: [
                {
                  id: '2-1',
                  nav_name: '模板消息',
                  c_name: 'templatemsg'
                },
                {
                  id: '2-2',
                  nav_name: '短信消息',
                  c_name: 'smsreminder'
                },
                {
                  id: '2-3',
                  nav_name: '打印机管理',
                  c_name: 'printerset'
                },
                {
                  id: '2-4',
                  nav_name: '语音提醒',
                  c_name: 'voicereminder'
                }
              ]
            },
            {
              id: '3',
              nav_name: '外卖设置',
              c_name: 'outset',
              icon: 'iconwaimaidingdan0101'
            },
            {
              id: '4',
              nav_name: '配送设置',
              icon: 'iconditu',
              children: [
                {
                  id: '4-1',
                  nav_name: '同城配送',
                  c_name: 'citydistribution'
                },
                {
                  id: '4-2',
                  nav_name: '配送区域',
                  c_name: 'regiondistribution'
                }
              ]
            }
          ]
        },
        {
          c_name: 'good',
          children: [
            {
              id: '1',
              nav_name: '外卖商品',
              icon: 'iconshangpin1',
              children: [
                {
                  id: '1-1',
                  nav_name: '商品管理',
                  c_name: 'good'
                },
                {
                  id: '1-2',
                  nav_name: '分类管理',
                  c_name: 'goodclassify'
                }
              ]
            },
            {
              id: '25',
              nav_name: '店内商品',
              icon: 'iconshangpin2',
              children: [
                {
                  id: '251',
                  nav_name: '商品管理',
                  c_name: 'ingoodlist'
                },
                {
                  id: '252',
                  nav_name: '分类管理',
                  c_name: 'ingoodclassify'
                }
              ]
            },
            {
              id: '2',
              nav_name: '商品扩展',
              icon: 'iconfenlei',
              children: [
                {
                  id: '2-1',
                  nav_name: '规格库',
                  c_name: 'goodspec'
                },
                {
                  id: '2-2',
                  nav_name: '属性库',
                  c_name: 'goodattribute'
                },
                {
                  id: '2-3',
                  nav_name: '加料库',
                  c_name: 'goodfeeding'
                },
                {
                  id: '2-4',
                  nav_name: '单位库',
                  c_name: 'goodunit'
                },
                {
                  id: '2-5',
                  nav_name: '商品标签',
                  c_name: 'goodlabel'
                },
                {
                  id: '2-6',
                  nav_name: '打印标签',
                  c_name: 'printlabel'
                }
              ]
            },
            {
              id: '3',
              nav_name: '快速导入',
              c_name: 'goodimport',
              icon: 'icondaoru'
            }
          ]
        },
        {
          c_name: 'usersurvey',
          children: [
            {
              id: '1',
              nav_name: '用户概况',
              c_name: 'usersurvey',
              icon: 'icontongji'
            },
            {
              id: '2',
              nav_name: '用户管理',
              icon: 'iconyonghu1',
              children: [
                {
                  id: '1-1',
                  nav_name: '用户查询',
                  c_name: 'userquery'
                },
                // {
                //     id: '1-2',
                //     nav_name: '用户导入',
                //     c_name: 'userimport',
                // },
                {
                  id: '1-3',
                  nav_name: '标签管理',
                  c_name: 'userlabel'
                }
              ]
            },
            {
              id: '3',
              nav_name: '会员管理',
              icon: 'iconyonghu1',
              children: [
                {
                  id: '3-1',
                  nav_name: '会员卡概况',
                  c_name: 'vipsurvey'
                },
                {
                  id: '3-2',
                  nav_name: '会员卡等级',
                  c_name: 'vipmange'
                },
                {
                  id: '3-3',
                  nav_name: '开卡记录',
                  c_name: 'vipquery'
                },
                {
                  id: '3-4',
                  nav_name: '会员卡设置',
                  c_name: 'vipset'
                }
              ]
            },
            {
              id: '4',
              nav_name: '用户设置',
              c_name: 'userset',
              icon: 'iconyonghushezhi-'
            }
          ]
        },
        {
          c_name: 'assetssurvey',
          children: [
            {
              id: '1',
              nav_name: '资产总览',
              c_name: 'assetssurvey',
              icon: 'iconcaiwu1'
            },
            {
              id: '2',
              nav_name: '门店财务',
              icon: 'iconcedaohang-caiwuguanl',
              children: [
                {
                  id: '1-1',
                  nav_name: '账户管理',
                  c_name: 'accountmange'
                },
                {
                  id: '1-2',
                  nav_name: '财务对账',
                  c_name: 'financerecord'
                }
              ]
            },
            {
              id: '3',
              nav_name: '余额明细',
              icon: 'iconcedaohang-caiwuguanl',
              children: [
                {
                  id: '3-1',
                  nav_name: '余额流水',
                  c_name: 'balance'
                }
              ]
            },
            {
              id: '4',
              nav_name: '积分明细',
              icon: 'iconcedaohang-caiwuguanl',
              children: [
                {
                  id: '3-1',
                  nav_name: '积分流水',
                  c_name: 'integralflow'
                }
              ]
            }
          ]
        },
        {
          c_name: 'renovationindex',
          children: [
            {
              id: '1',
              nav_name: '装修管理',
              icon: 'iconzhuangxiudianpu',
              children: [
                {
                  id: '1-1',
                  nav_name: '页面列表',
                  c_name: 'renovationindex'
                },
                {
                  id: '1-2',
                  nav_name: '全店风格',
                  c_name: 'storestyle'
                },
                {
                  id: '1-3',
                  nav_name: '点单风格',
                  c_name: 'storetemment'
                }
              ]
            },
            {
              id: '2',
              nav_name: '其他',
              icon: 'iconicon_xinyong_xianxing_jijin-',
              children: [
                {
                  id: '1-1',
                  nav_name: '素材管理',
                  c_name: 'materialmange'
                }
              ]
            }
          ]
        },
        {
          c_name: 'shopsurvey',
          children: [
            {
              id: '1',
              nav_name: '门店概况',
              c_name: 'shopsurvey',
              icon: 'icongaikuang'
            },
            {
              id: '2',
              nav_name: '门店列表',
              c_name: 'shoplist',
              icon: 'iconchazhaobiaodanliebiao'
            },
            {
              id: '3',
              nav_name: '提现申请',
              icon: 'icontixian',
              children: [
                {
                  id: '3-1',
                  nav_name: '提现列表',
                  c_name: 'withdrawalliest'
                },
                {
                  id: '3-2',
                  nav_name: '服务费率',
                  c_name: 'servicerate'
                },
                {
                  id: '3-3',
                  nav_name: '提现设置',
                  c_name: 'withdrawallset'
                }
              ]
            },
            {
              id: '4',
              nav_name: '门店类别',
              icon: 'iconleimupinleifenleileibie2',
              children: [
                {
                  id: '4-1',
                  nav_name: '门店分组',
                  c_name: 'shopclassify'
                },
                {
                  id: '4-2',
                  nav_name: '门店区域',
                  c_name: 'shopregion'
                },
                {
                  id: '4-3',
                  nav_name: '门店标签',
                  c_name: 'shoplabel'
                }
              ]
            },
            {
              id: '5',
              nav_name: '门店设置',
              c_name: 'shopset',
              icon: 'iconshezhi3'
            }
          ]
        },
        {
          c_name: 'datasurvey',
          children: [
            {
              id: '1',
              nav_name: '数据概况',
              c_name: 'datasurvey',
              icon: 'iconicon_website_huabanfuben'
            },
            {
              id: '6',
              nav_name: '外卖概况',
              icon: 'iconleimupinleifenleileibie2',
              children: [
                {
                  id: '6-1',
                  nav_name: '外卖概况1',
                  c_name: 'outsurvey1'
                },
                {
                  id: '6-2',
                  nav_name: '外卖概况2',
                  c_name: 'outsurvey2'
                },
                {
                  id: '6-3',
                  nav_name: '外卖概况3',
                  c_name: 'outsurvey3'
                }
              ]
            },
            {
              id: '7',
              nav_name: '店内概况',
              icon: 'iconleimupinleifenleileibie2',
              children: [
                {
                  id: '7-1',
                  nav_name: '店内概况1',
                  c_name: 'insurvey1'
                },
                {
                  id: '7-2',
                  nav_name: '店内概况2',
                  c_name: 'insurvey2'
                },
                {
                  id: '7-3',
                  nav_name: '店内概况3',
                  c_name: 'insurvey3'
                }
              ]
            },
            {
              id: '2',
              nav_name: '实时分析',
              c_name: 'realtime',
              icon: 'iconkuaijianliuliang'
            },
            {
              id: '3',
              nav_name: '流量分析',
              c_name: 'flowanalysis',
              icon: 'iconliuliang'
            },
            {
              id: '4',
              nav_name: '商品分析',
              c_name: 'outgood',
              icon: 'iconliulanqi'
            },
            {
              id: '5',
              nav_name: '交易分析',
              c_name: 'transactionanalysis',
              icon: 'iconjiaoyisuo'
            }
          ]
        },
        {
          c_name: 'application',
          children: [
            {
              id: '1',
              nav_name: '应用列表',
              c_name: 'application',
              icon: 'iconyingyong1'
            }
          ]
        },
        {
          c_name: 'baseset',
          children: [
            {
              id: '1',
              nav_name: '基础设置',
              c_name: 'baseset',
              icon: 'iconshezhi2'
            },
            {
              id: '2',
              nav_name: '通用设置',
              c_name: 'orderset',
              icon: 'iconshezhi1'
            },
            {
              id: '3',
              nav_name: '订单提醒',
              icon: 'icon10',
              children: [
                {
                  id: '1-1',
                  nav_name: '短信设置',
                  c_name: 'orderremind'
                },
                {
                  id: '1-2',
                  nav_name: '模板消息',
                  c_name: 'ptmsg'
                },
                {
                  id: '1-3',
                  nav_name: '打印设置',
                  c_name: 'ptprentset'
                },
                {
                  id: '1-4',
                  nav_name: '语音提醒',
                  c_name: 'ptautiomsg'
                }
              ]
            },
            {
              id: '4',
              nav_name: '支付设置',
              c_name: 'paymentset',
              icon: 'iconzhifu'
            },
            {
              id: '5',
              nav_name: '配送设置',
              c_name: 'distributionset',
              icon: 'iconwaimai'
            },
            {
              id: '6',
              nav_name: '其他设置',
              icon: 'iconqita',
              children: [
                {
                  id: '1-1',
                  nav_name: '页面标题',
                  c_name: 'pagetitle'
                },
                {
                  id: '1-2',
                  nav_name: '公告管理',
                  c_name: 'noticeset'
                },
                {
                  id: '1-4',
                  nav_name: '资讯管理',
                  c_name: 'infoset'
                },
                {
                  id: '1-5',
                  nav_name: '帮助中心',
                  c_name: 'otherset'
                },
                {
                  id: '1-6',
                  nav_name: '远程附件',
                  c_name: 'enclosure'
                }
              ]
            },
            {
              id: '7',
              nav_name: '员工管理',
              icon: 'iconquanxianshenyue',
              children: [
                {
                  id: '1-1',
                  nav_name: '员工列表',
                  c_name: 'manager'
                },
                {
                  id: '1-2',
                  nav_name: '角色管理',
                  c_name: 'role'
                }
              ]
            }
          ]
        },
        {
          c_name: 'appletlist',
          children: [
            {
              id: '1',
              nav_name: '小程序列表',
              c_name: 'appletlist',
              icon: 'iconxiaochengxushezhi'
            },
            {
              id: '2',
              nav_name: '授权管理',
              icon: 'iconjiaoseshouquan',
              children: [
                {
                  id: '2-1',
                  nav_name: '更新记录',
                  c_name: 'changelog'
                },
                {
                  id: '2-2',
                  nav_name: '授权详情',
                  c_name: 'empower'
                }
              ]
            },
            {
              id: '3',
              nav_name: '其他',
              icon: 'iconqita',
              children: [
                // {
                //     id: '3-1',
                //     nav_name: '超级权限',
                //     c_name: 'founder',
                // },
                {
                  id: '3-2',
                  nav_name: '缓存设置',
                  c_name: 'cacheset'
                }
              ]
            }
          ]
        },
        {
          c_name: 'miniapplets',
          children: [
            {
              id: '1',
              nav_name: '微信小程序',
              c_name: 'miniapplets',
              icon: 'iconxiaochengxushezhi'
            }
          ]
        },
        {
          c_name: 'wechatapplets',
          children: [
            {
              id: '1',
              nav_name: '微信公众号',
              c_name: 'wechatapplets',
              icon: 'iconweixingongzhonghao'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'wechattementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'wechatroute',
              icon: 'iconyemian1'
            }
          ]
        },
        {
          c_name: 'zfbapplets',
          children: [
            {
              id: '1',
              nav_name: '支付宝小程序',
              c_name: 'zfbapplets',
              icon: 'iconzhifubaoxiaochengxu-_huaban'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'zfbtementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'zfbroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'zfbdownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'baiduapplets',
          children: [
            {
              id: '1',
              nav_name: '百度小程序',
              c_name: 'baiduapplets',
              icon: 'icon-'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'baidutementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'baiduroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'baidudownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'dyapplets',
          children: [
            {
              id: '1',
              nav_name: '字节跳动小程序',
              c_name: 'dyapplets',
              icon: 'iconzijiediaodong'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'dytementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'dyroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'dydownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'livelist',
          children: [
            {
              id: '1',
              nav_name: '直播列表',
              c_name: 'livelist'
            },
            {
              id: '2',
              nav_name: '直播商品',
              c_name: 'livegoods'
            }
          ]
        },
        {
          c_name: 'valuerule',
          children: [
            {
              id: '1',
              nav_name: '储值规则',
              c_name: 'valuerule'
            },
            {
              id: '2',
              nav_name: '储值记录',
              c_name: 'valuerecord'
            },
            // {
            //     id: '2',
            //     nav_name: '储值查询',
            //     c_name: 'valuequery',
            // },
            {
              id: '3',
              nav_name: '储值设置',
              c_name: 'valueset'
            }
          ]
        },
        {
          c_name: 'managegood',
          children: [
            {
              id: '1',
              nav_name: '商品管理',
              c_name: 'managegood'
            },
            {
              id: '2',
              nav_name: '兑换记录',
              c_name: 'exchangerecord'
            },
            {
              id: '3',
              nav_name: '商品分类',
              c_name: 'integralgoodstype'
            },
            {
              id: '4',
              nav_name: '自提点设置',
              c_name: 'mentionpoint'
            },
            {
              id: '5',
              nav_name: '规则设置',
              c_name: 'integralmall'
            },
            {
              id: '6',
              nav_name: '广告管理',
              c_name: 'integralad'
            }
          ]
        },
        {
          c_name: 'signintj',
          children: [
            {
              id: '1',
              nav_name: '签到统计',
              c_name: 'signintj'
            },
            {
              id: '2',
              nav_name: '签到列表',
              c_name: 'signinlist'
            },
            {
              id: '3',
              nav_name: '签到设置',
              c_name: 'signin'
            }
          ]
        },
        {
          c_name: 'collectionlist',
          children: [
            {
              id: '1',
              nav_name: '审核列表',
              c_name: 'collectionlist'
            },
            {
              id: '2',
              nav_name: '收藏有礼设置',
              c_name: 'collectionAdd'
            }
          ]
        },
        {
          c_name: 'happybirthdaylist',
          children: [
            {
              id: '1',
              nav_name: '生日有礼',
              c_name: 'happybirthdaylist'
            },
            {
              id: '2',
              nav_name: '生日有礼设置',
              c_name: 'happybirthdaySet'
            }
          ]
        },
        {
          c_name: 'couponsbaglist',
          children: [
            {
              id: '1',
              nav_name: '发券宝',
              c_name: 'couponsbaglist'
            }
            // {
            //     id: '2',
            //     nav_name: '发券宝设置',
            //     c_name: 'couponsbaglistadd',
            // },
          ]
        },
        {
          c_name: 'windowcoupon',
          children: [
            {
              id: '1',
              nav_name: '弹窗优惠券',
              c_name: 'windowcoupon'
            }
          ]
        },
        {
          c_name: 'exchangelist',
          children: [
            {
              id: '1',
              nav_name: '兑换码',
              c_name: 'exchangelist'
            }
            // {
            //     id: '2',
            //     nav_name: '新建兑换码',
            //     c_name: 'exchangeadd',
            // },
          ]
        },
        {
          c_name: 'informationlist',
          children: [
            {
              id: '1',
              nav_name: '资讯列表',
              c_name: 'informationlist'
            },
            {
              id: '2',
              nav_name: '资讯设置',
              c_name: 'informationset'
            }
          ]
        },
        {
          c_name: 'rollbaglist',
          children: [
            {
              id: '1',
              nav_name: '券包列表',
              c_name: 'rollbaglist'
            },
            {
              id: '2',
              nav_name: '新建券包',
              c_name: 'rollbagadd'
            }
          ]
        }
      ],
      topMenu: [],
      leftMenu: [],
      leftDataLength: [],
      newsUrl: require('@/assets/audio/newsUrl.mp3'),
      urgeOrderUrl: require('@/assets/audio/urgeOrderUrl.mp3'),
      cancelOrderUrl: require('@/assets/audio/cancelOrderUrl.mp3'),
      retreatOrderUrl: require('@/assets/audio/retreatOrderUrl.mp3'),
      autoOrderUrl: require('@/assets/audio/autoOrderUrl.mp3'),
      edition: '' ,//判断微擎版本和独立版2是独立版
      // role:'', //判断微擎版本和的超级权限，==founder的时候是超级管理员才显示左边菜单的超级权限
      systemData:{},
    };
  },
  created() {
    this.getTitle();
    this.getLogo();
    this.getWaitReceiv();
    this.getMarket();
    this.edition = sessionStorage.getItem('edition') ? sessionStorage.getItem('edition') : '';
    if (this.edition == '') {
      this.getEdition();
    }
    // console.log('menuNav',sessionStorage.getItem('topMenu'))
    if (sessionStorage.getItem('topMenu') && eval(sessionStorage.getItem('topMenu')).length) {
      let sessiontopMenu = sessionStorage.getItem('topMenu');
      let sessionleftMenu = sessionStorage.getItem('leftMenu');
      this.topMenu = JSON.parse(sessiontopMenu);
      this.leftMenu = JSON.parse(sessionleftMenu);
    } else {
      this.checkRoleNav();
    }
    // console.log('menuNav',sessionStorage.getItem('menuNav'))
    // this.checkRoleNav()
    this.menuCurrent = this.storeMenuCurrent;
    // console.log('storeMenuCurrent',this.storeMenuCurrent)
    this.menuCurrent = sessionStorage.getItem('menuCurrent') ? sessionStorage.getItem('menuCurrent') : '/';
    this.leftActive = sessionStorage.getItem('leftActive') ? sessionStorage.getItem('leftActive') : '1-1';
    this.leftOpenName = sessionStorage.getItem('leftOpenName') ? JSON.parse(sessionStorage.getItem('leftOpenName')) : ['1'];
  },
  computed: {
    ...mapState(['updataOrder', 'storeMenuCurrent', 'nav'])
  },
  watch: {
    updataOrder() {
      this.getWaitReceiv();
    }
  },
  methods: {
    ...mapActions(['getStoreOrderList']),
    ...mapMutations(['searchMarket', 'setmenuCurrent', 'menuNav']),
    // start查询商家
    async getMarket() {
      const { data } = await selectStore();
      this.searchMarket(data);
    },
    // end查询商家
    // start订单处理
    async getWaitReceiv() {
      const { data } = await waitReceiv();
      this.orderNumber = data;
    },
    updataNumber(status) {
      if (status) this.getWaitReceiv();
    },
    // end订单处理
    async getTitle() {
      const { data, loginType } = await getConfig({ ident: 'system' });
      document.title = data.name ? data.name + '-管理后台' : '管理后台';
      this.portrait = data.portrait;
      this.loginType = loginType;
      this.systemData = data
      // this.role = data.role?data.role:''
      this.upLoad2(this);
    },
    async getLogo() {
      const { data } = await getCopy();
      this.headLogo = data.icon;
      this.copy = data.content;
    },
    async getEdition() {
      const { data } = await getEdition();
      this.edition = data;
      sessionStorage.setItem('edition', data);
    },
    async checkRoleNav() {
      const { data } = await checkRoleNav();
      // console.log(data,this.nav)

      var leftData = data;
      var leftData2 = copyArr(leftData);
      function copyArr(leftData) {
        let res = [];
        for (let i = 0; i < leftData.length; i++) {
          res.push(leftData[i]);
        }
        return res;
      }
      this.menuNav(data);
      this.topMenu = this.nav ? this.nav && leftData2 : [];
      this.leftMenu = this.nav ? this.nav : [];
      this.leftMenu.push(
        {
          c_name: 'miniapplets',
          children: [
            {
              id: '1',
              nav_name: '微信小程序',
              c_name: 'miniapplets',
              icon: 'iconxiaochengxushezhi'
            }
          ]
        },
        {
          c_name: 'wechatapplets',
          children: [
            {
              id: '1',
              nav_name: '微信公众号',
              c_name: 'wechatapplets',
              icon: 'iconweixingongzhonghao'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'wechattementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'wechatroute',
              icon: 'iconyemian1'
            }
          ]
        },
        {
          c_name: 'zfbapplets',
          children: [
            {
              id: '1',
              nav_name: '支付宝小程序',
              c_name: 'zfbapplets',
              icon: 'iconzhifubaoxiaochengxu-_huaban'
            },
            {
              id: '5',
              nav_name: '蚂蚁门店',
              c_name: 'zfbmyshop',
              icon: 'iconpublish'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'zfbtementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'zfbroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'zfbdownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'baiduapplets',
          children: [
            {
              id: '1',
              nav_name: '百度小程序',
              c_name: 'baiduapplets',
              icon: 'icon-'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'baidutementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'baiduroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'baidudownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'dyapplets',
          children: [
            {
              id: '1',
              nav_name: '字节跳动小程序',
              c_name: 'dyapplets',
              icon: 'iconzijiediaodong'
            },
            {
              id: '2',
              nav_name: '模板消息',
              c_name: 'dytementmsg',
              icon: 'iconxiaoxi'
            },
            {
              id: '3',
              nav_name: '页面路径',
              c_name: 'dyroute',
              icon: 'iconyemian1'
            },
            {
              id: '4',
              nav_name: '小程序发布',
              c_name: 'dydownload',
              icon: 'iconpublish'
            }
          ]
        },
        {
          c_name: 'livelist',
          children: [
            {
              id: '1',
              nav_name: '直播列表',
              c_name: 'livelist'
            },
            {
              id: '2',
              nav_name: '直播商品',
              c_name: 'livegoods'
            }
          ]
        },
        {
          c_name: 'valuerule',
          children: [
            {
              id: '1',
              nav_name: '储值规则',
              c_name: 'valuerule'
            },
            // {
            //     id: '2',
            //     nav_name: '储值分析',
            //     c_name: 'valuequery',
            // },
            {
              id: '2',
              nav_name: '储值记录',
              c_name: 'valuerecord'
            },
            {
              id: '3',
              nav_name: '储值设置',
              c_name: 'valueset'
            }
          ]
        },
        {
          c_name: 'managegood',
          children: [
            {
              id: '1',
              nav_name: '商品管理',
              c_name: 'managegood'
            },
            {
              id: '2',
              nav_name: '兑换记录',
              c_name: 'exchangerecord'
            },
            {
              id: '3',
              nav_name: '商品分类',
              c_name: 'integralgoodstype'
            },
            {
              id: '4',
              nav_name: '自提点设置',
              c_name: 'mentionpoint'
            },
            {
              id: '5',
              nav_name: '规则设置',
              c_name: 'integralmall'
            },
            {
              id: '6',
              nav_name: '广告管理',
              c_name: 'integralad'
            }
          ]
        },
        {
          c_name: 'signintj',
          children: [
            {
              id: '1',
              nav_name: '签到统计',
              c_name: 'signintj'
            },
            {
              id: '2',
              nav_name: '签到列表',
              c_name: 'signinlist'
            },
            {
              id: '3',
              nav_name: '签到设置',
              c_name: 'signin'
            }
          ]
        },
        {
          c_name: 'collectionlist',
          children: [
            {
              id: '1',
              nav_name: '审核列表',
              c_name: 'collectionlist'
            },
            {
              id: '2',
              nav_name: '收藏有礼设置',
              c_name: 'collectionAdd'
            }
          ]
        },
        {
          c_name: 'happybirthdaylist',
          children: [
            {
              id: '1',
              nav_name: '生日有礼',
              c_name: 'happybirthdaylist'
            },
            {
              id: '2',
              nav_name: '生日有礼设置',
              c_name: 'happybirthdaySet'
            }
          ]
        },
        {
          c_name: 'couponsbaglist',
          children: [
            {
              id: '1',
              nav_name: '发券宝',
              c_name: 'couponsbaglist'
            }
          ]
        },
        {
          c_name: 'windowcoupon',
          children: [
            {
              id: '1',
              nav_name: '弹窗优惠券',
              c_name: 'windowcoupon'
            }
          ]
        },
        {
          c_name: 'exchangelist',
          children: [
            {
              id: '1',
              nav_name: '兑换码',
              c_name: 'exchangelist'
            }
            // {
            //     id: '2',
            //     nav_name: '新建兑换码',
            //     c_name: 'exchangeadd',
            // },
          ]
        },
        {
          c_name: 'informationlist',
          children: [
            {
              id: '1',
              nav_name: '资讯列表',
              c_name: 'informationlist'
            }
            // {
            //     id: '2',
            //     nav_name: '资讯设置',
            //     c_name: 'informationset',
            // },
          ]
        },
        {
          c_name: 'rollbaglist',
          children: [
            {
              id: '1',
              nav_name: '券包列表',
              c_name: 'rollbaglist'
            },
            {
              id: '2',
              nav_name: '新建券包',
              c_name: 'rollbagadd'
            }
          ]
        },
        {
          c_name: 'distribution',
          children: [
            {
              id: '1',
              nav_name: '分销概况',
              c_name: 'distribution'
            },
            {
              id: '2',
              nav_name: '分销订单',
              c_name: 'distributionOrder'
            },
            {
              id: '3',
              nav_name: '分销商管理',
              c_name: 'distributionAdmin'
            },
            {
              id: '4',
              nav_name: '提现管理',
              c_name: 'WithdrawalSet'
            },
            {
              id: '5',
              nav_name: '分销设置',
              c_name: 'distStteing'
            }
          ]
        },
        {
          c_name: 'oldOrNew',
          children: [
            {
              id: '1',
              nav_name: '老带新活动',
              c_name: 'oldOrNew'
            },
            {
              id: '2',
              nav_name: '邀请记录',
              c_name: 'InvitationRecord'
            },
            {
              id: '3',
              nav_name: '奖励明细',
              c_name: 'rewardInfo'
            },
            {
              id: '4',
              nav_name: '提现设置',
              c_name: 'oldWithdrawalSet'
            }
          ]
        },
        {
          c_name: 'card',
          children: [
            {
              id: '1',
              nav_name: '会员概况',
              c_name: 'card'
            },
            {
              id: '2',
              nav_name: '会员卡配置',
              c_name: 'vipConfig'
            },
            {
              id: '3',
              nav_name: '开卡记录',
              c_name: 'vipList'
            }
          ]
        },
        {
          c_name: 'cashReg',
          children: [
            {
              id: '1',
              nav_name: '基础设置',
              c_name: 'cashReg'
            },
            {
              id: '2',
              nav_name: '收银员管理',
              c_name: 'carRegT'
            }
            // {
            //   id: '3',
            //   nav_name: '业绩明细',
            //   c_name: 'acmtInfo'
            // },
            // {
            //   id: '4',
            //   nav_name: '交班记录',
            //   c_name: 'shiftHandover'
            // }
          ]
        },
          {
            c_name: 'queuingdetails',
            children: [
              {
                id: '1',
                nav_name: '排队取号',
                c_name: 'queuingdetails'
              },
              {
                id: '2',
                nav_name: '桌位类型',
                c_name: 'queuingtype'
              },
              {
                id: '3',
                nav_name: '排队设置',
                c_name: 'queuingset'
              }
            ]
          },
          {
            c_name: 'storage',
            children: [
              {
                id: '1',
                nav_name: '存酒记录',
                c_name: 'storage'
              },
              {
                id: '2',
                nav_name: '取酒记录',
                c_name: 'storagerecord'
              },
              {
                id: '3',
                nav_name: '酒品名称',
                c_name: 'storagebrand'
              },
              {
                id: '4',
                nav_name: '存酒设置',
                c_name: 'storageset'
              },
            ]
          },
          {
            c_name: 'appointmentlist',
            children: [
              {
                id: '1',
                nav_name: '预约订单',
                c_name: 'appointmentlist'
              },
              {
                id: '2',
                nav_name: '全部订单',
                c_name: 'appointmentorder'
              },
              {
                id: '3',
                nav_name: '预约设置',
                c_name: 'appointmentstoreset'
              },
            ]
          },
          {
            c_name: 'dividend',
            children: [
              {
                id: '1',
                nav_name: '瓜分红包',
                c_name: 'dividend'
              },
              {
                id: '3',
                nav_name: '领取明细',
                c_name: 'divideinfo'
              },
              {
                id: '4',
                nav_name: '瓜分明细',
                c_name: 'divideinfotwo'
              },
              // {
              //   id: '5',
              //   nav_name: '瓜分红包设置',
              //   c_name: 'appointmentstoreset'
              // },
            ]
          },
          {
            c_name: 'mynumber',
            children: [
              {
                id: '1',
                nav_name: '账号管理',
                c_name: 'mynumber',
                icon: 'iconquanxianshenyue'
              }
            ]
          },
      );
      sessionStorage.setItem('topMenu', JSON.stringify(leftData2)); //设置菜单缓存
      sessionStorage.setItem('leftMenu', JSON.stringify(this.nav)); //设置菜单缓存
      // console.log('left',this.leftMenu,this.nav,leftData2)
    },
    upLoad() {
      const publishUrl = 'wss://' + 'bkycms.com' + ':9875';
      const backendPath = index.isDev ? publishUrl : 'wss://' + window.location.host + ':9875';
      if ('WebSocket' in window) {
        // alert("您的浏览器支持 WebSocket!");
        // 打开一个 web socket
        var that = this;
        // console.log('publishUrl',backendPath)
        var ws = new WebSocket(backendPath);
        console.log(ws);
        ws.onopen = function () {
          ws.send('发送数据');
          console.log('连接成功');
          setInterval(function () {
            ws.send('beatheart');
          }, 3000);
        };
        ws.onmessage = function (evt) {
          // var received_msg = evt.data;
          console.log('接收到消息' + evt.data);
          let hdData = JSON.parse(evt.data);
          if (hdData.num && hdData.voiceName) {
            that.Orderprocessing1(hdData.num);
            var params = {
              page: '1',
              state: '1'
            };
            that.getStoreOrderList(params);
          }
          // ws.send('等待接收数据')
        };
        ws.onclose = function () {
          console.log('连接已关闭');
          // alert("连接已关闭...");
        };
      } else {
        // 浏览器不支持 WebSocket
        alert('您的浏览器不支持 WebSocket!');
      }
    },
    upLoad2(_that) {
      _that.lockReconnect = false; //避免ws重复连接
      _that.ws = null; // 判断当前浏览器是否支持WebSocket
      const publishUrl = 'wss://' + 'bkycms.com' + ':9875';
      var wsUrl = index.isDev ? publishUrl : 'wss://' + window.location.host + ':9875';
      createWebSocket(wsUrl); //连接ws
      function createWebSocket(url) {
        try {
          if ('WebSocket' in window) {
            _that.ws = new WebSocket(url);
          }
          initEventHandle();
        } catch (e) {
          reconnect(url);
          // console.log(e);
        }
      }

      function initEventHandle() {
        _that.ws.onclose = function () {
          reconnect(wsUrl);
          // console.log("llws连接关闭!"+new Date().toLocaleString());
        };
        _that.ws.onerror = function () {
          reconnect(wsUrl);
          // console.log("llws连接错误!");
        };
        _that.ws.onopen = function () {
          heartCheck.reset().start(); //心跳检测重置
          // console.log("llws连接成功!"+new Date().toLocaleString());
        };
        _that.ws.onmessage = function (event) {
          //如果获取到消息，心跳检测重置
          heartCheck.reset().start(); //拿到任何消息都说明当前连接是正常的
          console.log('llws收到消息啦:' + event.data);
          if (event.data) {
            //处理业务逻辑
            var hdData = JSON.parse(event.data);
            if (hdData.voiceName) {
              if(hdData.uniacid == _that.systemData.uniacid && hdData.storeId == _that.systemData.storeId){
                // let hdData = event.data
                if (hdData.num && hdData.voiceName) {
                  _that.Orderprocessing1(hdData.num,hdData.voiceName);
                  var params = {
                    page: '1',
                    state: '1',
                  };
                  _that.getStoreOrderList(params);
                }
                if (hdData.orderId) {
                  console.log('orderId',hdData)
                  print(hdData.orderId);
                }
              }
            }
          }
        };
      }
      // 监听窗口关闭事件，当窗口关闭时，主动去关闭websocket连接，防止连接还没断开就关闭窗口，server端会抛异常。
      window.onbeforeunload = function () {
        _that.ws.close();
      };
      async function print(id) {
        const { data } = await orderContent({orderId:id});
        console.log(data)
        Object.keys(data).map(key=>{
          _that.printData = data[key];
          _that.$nextTick(() => {
            _that.$refs.print.printElement(key);
          });
        })
      }
      function reconnect(url) {
        if (_that.lockReconnect) return;
        _that.lockReconnect = true;
        setTimeout(function () {
          //没连接上会一直重连，设置延迟避免请求过多
          createWebSocket(url);
          _that.lockReconnect = false;
        }, 2000);
      }
      //心跳检测
      var heartCheck = {
        timeout: 1000, //1分钟发一次心跳
        timeoutObj: null,
        serverTimeoutObj: null,
        reset: function () {
          clearTimeout(this.timeoutObj);
          clearTimeout(this.serverTimeoutObj);
          return this;
        },
        start: function () {
          var self = this;
          this.timeoutObj = setTimeout(function () {
            //这里发送一个心跳，后端收到后，返回一个心跳消息，
            //onmessage拿到返回的心跳就说明连接正常
            _that.ws.send('ping');
            // console.log("ping!")
            self.serverTimeoutObj = setTimeout(function () {
              //如果超过一定时间还没重置，说明后端主动断开了
              _that.ws.close(); //如果onclose会执行reconnect，我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
            }, self.timeout);
          }, this.timeout);
        }
      };
    },
    Orderprocessing1(num,name) {
      var vid = ''
      switch (name) {
        case 'newOrder':
          vid = document.getElementById('newsUrl')
          break;
        case 'reminderOrder':
          vid = document.getElementById('urgeOrderUrl')
          break;
        case 'cancelOrder':
          vid = document.getElementById('cancelOrderUrl')
          break;
        case 'chargebackOrder':
          vid = document.getElementById('retreatOrderUrl')
          break;
        case 'receiving':
          vid = document.getElementById('autoOrderUrl')
          break;
      }
      var start = 0; //定义循环的变量
      var times = num; //定于循环的次数
      vid.addEventListener('ended', function () {
        vid.play(); //启动音频，也就是播放
        start++; //循环
        start == times && vid.pause(); //也就是当循环的变量等于次数的时候，就会终止循环并且关掉音频
      });
      vid.play(); //启动音频，用于第一次启动
    },
    showToggle(name) {
      // console.log('toubu',name,this.leftOpenName)
      this.$router.push({ path: name });
      this.setmenuCurrent(name);
      // this.menuCurrent = this.storeMenuCurrent
      sessionStorage.clear('leftActive');
      this.leftActive = '1';
      this.leftOpenName = ['1'];
      sessionStorage.setItem('menuCurrent', name);
    },
    showSubOpenmenu(name) {
      // console.log('open',name)
      sessionStorage.setItem('leftOpenName', JSON.stringify(name));
      this.leftOpenName = name;
    },
    showSubmenu(name) {
      // console.log(name)
      sessionStorage.setItem('leftActive', name);
      this.leftActive = name;
      // return
      // let menuCurrent = this.menuCurrent
    },
    myNumber() {
      // this.menuCurrent = 13;
      this.$router.push({ path: 'mynumber' });
      sessionStorage.setItem('menuCurrent', 'mynumber');
      this.setmenuCurrent('mynumber');
    },
    async returnSystem() {
      const { data } = await getUrl();
      window.open(data.returnSystem, '_blank');
    },
    async outSystem() {
      if (this.loginType == 2) {
        this.$router.push({ path: '/login' });
      } else {
        const { data } = await getUrl();
        if (data.outSystem) {
          const { msg } = await signOut();
          this.$baseMessage(msg, 'success');
          window.open(data.outSystem, '_self');
        }
      }
    }
  },
  destroyed(){
    console.log('页面销毁')
    //禁止重连
    this.lockReconnect = true
    this.ws.close()
  },
};
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #333;
  height: 100%;
}

.layout {
  height: 100%;
  min-width: 1700px !important;
}
.leftLayout{
  width: 100%;
  overflow-x: hidden;
}
.ivu-layout-sider-children{
  //width: 200px;
  //box-sizing: border-box;
  //padding-right: 20px;
}
.ivu-menu-vertical.ivu-menu-light:after {
  width: 0px !important;
}

.ivu-layout {
  height: 100%;
}

.ivu-layout-header {
  background: #ffffff!important;
  border-bottom: 1px solid #e9edef;
  padding: 0 !important;
}

.ivu-menu-primary {
  background: none !important;
}

.i-layout-header-logo-stick {
  width: 120px;
  background-color: #1C2C3C;
  border-bottom: 1px solid #111216;
  text-align: center;
}

.i-layout-header-logo {
  display: inline-block;
  height: 64px;
  line-height: 64px;
}

.i-link-color,
.i-link-color:active,
.i-link-color:hover {
  color: inherit;
}

.i-link {
  cursor: pointer;
}

.i-layout-header-logo img {
  height: 70%;
  vertical-align: middle;
}

.ivu-menu-light {
  text-align: left;
  height: 100%;
  padding-top: 10px;
}

.right_model {
  padding: 0 40px;

  .logo2 {
    width: 32px;
    height: 32px;
  }
}

.ivu-menu-horizontal {
  height: 58px !important;
  line-height: 58px !important;
}

.yysj {
  top: 45px !important;
  left: 1570px !important;
}

.copayRight {
  padding: 10px;
  width: 100%;
  background: #fff;
  position: fixed;
  bottom: 0;
  line-height: 24px;
}
.el-dropdown-menu {
  width: 100px;
}
.left-menu-1 {
  background-color: #1C2C3C;
  cursor: pointer;
  width: 120px;
  padding-top: 10px;
  position: relative;
  overflow-y: auto;
  z-index: 1000;

}

.ivu-layout.ivu-layout-has-sider {
  background-color: #1C2C3C;
}

.ivu-layout {
    display: flex;
    flex-direction: column;
    flex: auto;
    background: #f5f7f9;
    overflow-x: hidden;
}

.ivu-menu-vertical .ivu-menu-item, .ivu-menu-vertical .ivu-menu-submenu-title {
    padding: 14px 20px;
    position: relative;
    cursor: pointer;
    z-index: 1;
    transition: all .2s ease-in-out;
}

.ivu-menu-vertical .ivu-menu-submenu-title-icon {
    right: 8px !important;
}

.oneMenu .ivu-menu-item-active {
    background-color: #2d8cf0;
}

.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-item:hover {
    background-color: #26394B;
}

.ivu-menu-horizontal .ivu-menu-item, .ivu-menu-horizontal .ivu-menu-submenu {
    width: 120px;
}

.modal-name {
	box-sizing: border-box;
	width: 140px;
	height: 64px;
	text-align: center;
	line-height: 64px;
	border-right: 1px solid #e9edef;
	color: #000;
}
</style>
